import Vue from 'vue'
import App from './App.vue'
import router from "./router"
import store from "./store"
import { getConfigKey } from "@/api/system/config";
import plugins from "./plugins" // plugins
// UI 组件库
import * as UniDesignVue from '@uni/vue';
// 字典标签组件
import DictTag from '@/components/DictTag'
// 字典数据组件
import DictData from '@/components/DictData'
// 文件上传组件
import FileUpload from "@/components/FileUpload"
// 视频播放组件
import VideoPlayer from 'vue-video-player/src'
import 'vue-video-player/src/custom-theme.css'
import 'video.js/dist/video-js.css';
// 通用提示框
import messagebox from '@/utils/message.js'
Vue.prototype.$MessageBox = messagebox
// 导入样式表
import '@uni/vue/lib/index.css';
import "./assets/css/global.css";
import "./assets/css/uni.scss";
import NProgress from "nprogress"
import "nprogress/nprogress.css"
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree, getCurrentTime } from "@/utils/ruoyi";
import './permission' // permission control

Vue.config.productionTip = false;
Vue.prototype.getConfigKey = getConfigKey

Vue.use(plugins)
Vue.use(VideoPlayer)
Vue.use({
  install(app) {
    Object.values(UniDesignVue).forEach((e) => {
      e.install ? e.install(app) : app.component(e.name, e);
    });
  },
});
DictData.install()

// 全局组件挂载
Vue.component('DictTag', DictTag)
Vue.component('FileUpload', FileUpload)

// 全局方法挂载
// Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.getCurrentTime = getCurrentTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
// Vue.prototype.download = download
Vue.prototype.handleTree = handleTree

new Vue({
  router,
  store,
  render: h => h(UniDesignVue.ThemeProvider, [h(App)]),
}).$mount('#app')
